package com.pigcloud.sop.gateway.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.FieldNameConstants;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 接口监控信息
 * </p>
 *
 * @author wangfm
 * @since 2024-01-03
 */
@Data
@FieldNameConstants
@TableName("monitor_info")
@ApiModel("MonitorInfo")
public class MonitorInfo {
    @TableId("id")
    private Long id;
    @ApiModelProperty("路由id")
    @TableField("route_id")
    private String routeId;

    @ApiModelProperty("接口名")
    @TableField("name")
    private String name;

    @ApiModelProperty("版本号")
    @TableField("version")
    private String version;

    @TableField("service_id")
    private String serviceId;

    @TableField("instance_id")
    private String instanceId;

    @ApiModelProperty("请求耗时最长时间")
    @TableField("max_time")
    private Integer maxTime;

    @ApiModelProperty("请求耗时最小时间")
    @TableField("min_time")
    private Integer minTime;

    @ApiModelProperty("总时长，毫秒")
    @TableField("total_time")
    private Long totalTime;

    @ApiModelProperty("总调用次数")
    @TableField("total_request_count")
    private Long totalRequestCount;

    @ApiModelProperty("成功次数")
    @TableField("success_count")
    private Long successCount;

    @ApiModelProperty("失败次数（业务主动抛出的异常算作成功，如参数校验，未知的错误算失败）")
    @TableField("error_count")
    private Long errorCount;

    @TableField("create_time")
    private LocalDateTime createTime;

    @TableField("update_time")
    private LocalDateTime updateTime;


}
